package com.collaboration.electron.services;

import com.collaboration.electron.dao.CompositionRepository;
import com.collaboration.electron.entities.Composition;
import com.collaboration.electron.entities.DetailedComposition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author pinzi
 * @param
 * @return 无
 */

@Service
public class CompositionService {

    @Autowired
    CompositionRepository compositionRepository;

    public List<Composition> getAll(){

        return compositionRepository.findAll();
    }

    public Composition save(Composition composition){
        return compositionRepository.save(composition);
    }

    public List<Composition> findAllByDetailedComposition(DetailedComposition detailedComposition){
        return compositionRepository.findAllByDetailedComposition(detailedComposition);
    }
}
